<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="function.Open" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:useBean class="show.Detail_show" id="det" scope="request" /><jsp:useBean class="show.Main_show" id="mai" scope="request" /><link rel="stylesheet" href="../js/themes/base/jquery.ui.all.css">
<script src="../js/jquery-1.5.1.js"></script>
<script src="../js/ui/jquery.ui.core.js"></script>
<script src="../js/ui/jquery.ui.widget.js"></script>
<script src="../js/ui/jquery.ui.accordion.js"></script>
<script src="../js/ui/jquery.ui.button.js"></script>
<script src="../js/table.js" language="javascript"></script>
<script language="javascript">
window.onload = function()
{
//    window.location="main.jsp";
	page = new Page(10,"people","peo_name");
}
</script>
<script>
//	$(function() {
//		var icons = {
//			header: "ui-icon-circle-arrow-e",
//			headerSelected: "ui-icon-circle-arrow-s"
//		};
//		$( "#accordion" ).accordion({
//			icons: icons
//		});
//		$( "#toggle" ).button().toggle(function() {
//			$( "#accordion" ).accordion( "option", "icons", false );
//		}, function() {
//			$( "#accordion" ).accordion( "option", "icons", icons );
//		});
//	});
	$(function() {
		$( "#accordion" ).accordion({
			autoHeight: false,
			navigation: true
		});
	});

</script>
</head>
<body>
<%
       response.setHeader("Cache-Control","no-store");
       response.setDateHeader("Expires", 0);
       response.setHeader("Pragma","no-cache"); 
	   boolean isLog = false;
	   String name = null;
	   name = (String)session.getAttribute("name");
	   int id = 1;
	   Open o = null;
	   int haveOpen = 0;
	   int msgO = 0;
	   if(name!=null)
	   {
	         isLog = true;
			 id = mai.getID().get(mai.getNAME().indexOf(name));
			 o = new Open(id);
			 haveOpen = o.have(id);
			 if(haveOpen == 1000)
			 {
			       msgO = 0;
			 }
			 else
			 {
			 	   msgO = o.getFunc().get(haveOpen).getMsg();
			 }
	   }
	   String mess;
	   if(isLog)
	   {
	       mess = "您好，"+name+" 欢迎登陆！";
	   }
	   else
	   {
	       mess = "您好，游客";
	   }
%>
<div class="demo" style="position:absolute; top:35px; width:200px;">
  <div id="accordion">
    <h3><a href="#">用户基本信息</a></h3>
    <div>
      <p>
        <%if(!isLog){out.print("如果你想查看更多的信息，你必须得登陆");}else{out.print(name+" 您好，您可以选择开通你的留言板,您还可以使用系统提供给的代码重复判断功能。");}%>
      </p>
      <p>
        <%if(isLog){if(!name.equals("monitor")||name.equals("counselor"))out.print("<a href='modifyOwn.jsp?id="+id+"' target='infoFrame'>修改信息</a>");else{out.print("<a href='select.jsp' target='infoFrame'>修改信息</a>");}}else{out.print("<a href='#' onclick='alert(\"登陆以修改信息!\")'>修改信息</a>");}%>
      </p>
      <p><a href="base.jsp" target="infoFrame">查看全部</a></p>
    </div>
    <h3><a href="#">用户高级信息</a></h3>
    <div>
      <p>
        <%if(!isLog){out.print("用户高级信息请登陆查看");}else{out.print("选择被访者<br />");out.print("<table id='people'><tbody id='peo_name'>");for(int i = 0;i<det.getNAME().size();i++){out.print("<tr><td>"+(i+1)+":<a href='detail.jsp?id="+det.getID().get(i)+"' target='infoFrame'>"+det.getNAME().get(i)+"</a></td></tr>");}}out.print("</tbody></table>");%>
      </p>
      <%if(isLog){out.print("<table><tr><td><a href='#' onclick='page.nextPage();'>下组</a></td><td><a href='#' onclick='page.prePage();'>上组</a></td><td><span id='pageindex'></span></td></tr></table>");}%>
    </div>
    <h3><a href="#">系统工具</a></h3>
    <div>
      <p>
      <%if(isLog){if(msgO == 0)out.print("<a href='msg.jsp?msg=1&id="+id+"' target='infoFrame' id='openMsg'>开通留言板</a>");else{out.print("<a href='msg.jsp?msg=0&id="+id+"' target='infoFrame' id='closeMsg'>关闭留言板</a>");} }else{out.print("想要查看系统提供的功能，您就必须得登陆");}  %>
      <br />
      <%if(isLog){out.print("查看财务表"); }  %>
      </p>
    </div>
    <h3><a href="#">判断重复</a></h3>
    <div>
      <p></p>
    </div>
  </div>
</div>

<div id="top">
  <table width="100%" height="35px" style="position:absolute; top:-1px; left:-1px; margin-left:auto; margin-right:auto;">
    <tr bgcolor="#E0E0E0">
      <td align="right"><font size="+1"><%=mess%></font></td>
      <td><%if(!isLog)out.print("<a href='../login.jsp'>请登陆</a>");else{out.print("<a href='../logout.jsp'>注销</a>");}%></td>
    </tr>
  </table>
</div>
<div id="frameDiv" style="position:absolute;left:230px; top:35px;">
  <iframe name="infoFrame" id="infoFrame" frameborder="0" scrolling="auto" width="1100px" height="600px"> </iframe>
</div>
</body>
</html>
